using System;
using System.Collections.Generic;
using System.Text;
namespace GSM.BusinessLayer
{
	public class UserAccount: BusinessObjectBase
	{

		#region InnerClass
		public enum UserAccountFields
		{
			UserID,
			UserName,
			Password,
			Name,
			Gender,
			Address,
			District,
			City,
			Birthday,
			HomePhone,
			CellPhone,
			Email,
			UserType,
			Deleted
		}
		#endregion

		#region Data Members

			int _userID;
			string _userName;
			string _password;
			string _name;
			bool? _gender;
			string _address;
			string _district;
			string _city;
			DateTime? _birthday;
			string _homePhone;
			string _cellPhone;
			string _email;
			string _userType;
			bool? _deleted;

		#endregion

		#region Properties

		public int  UserID
		{
			 get { return _userID; }
			 set
			 {
				 if (_userID != value)
				 {
					_userID = value;
					 PropertyHasChanged("UserID");
				 }
			 }
		}

		public string  UserName
		{
			 get { return _userName; }
			 set
			 {
				 if (_userName != value)
				 {
					_userName = value;
					 PropertyHasChanged("UserName");
				 }
			 }
		}

		public string  Password
		{
			 get { return _password; }
			 set
			 {
				 if (_password != value)
				 {
					_password = value;
					 PropertyHasChanged("Password");
				 }
			 }
		}

		public string  Name
		{
			 get { return _name; }
			 set
			 {
				 if (_name != value)
				 {
					_name = value;
					 PropertyHasChanged("Name");
				 }
			 }
		}

		public bool?  Gender
		{
			 get { return _gender; }
			 set
			 {
				 if (_gender != value)
				 {
					_gender = value;
					 PropertyHasChanged("Gender");
				 }
			 }
		}

		public string  Address
		{
			 get { return _address; }
			 set
			 {
				 if (_address != value)
				 {
					_address = value;
					 PropertyHasChanged("Address");
				 }
			 }
		}

		public string  District
		{
			 get { return _district; }
			 set
			 {
				 if (_district != value)
				 {
					_district = value;
					 PropertyHasChanged("District");
				 }
			 }
		}

		public string  City
		{
			 get { return _city; }
			 set
			 {
				 if (_city != value)
				 {
					_city = value;
					 PropertyHasChanged("City");
				 }
			 }
		}

		public DateTime?  Birthday
		{
			 get { return _birthday; }
			 set
			 {
				 if (_birthday != value)
				 {
					_birthday = value;
					 PropertyHasChanged("Birthday");
				 }
			 }
		}

		public string  HomePhone
		{
			 get { return _homePhone; }
			 set
			 {
				 if (_homePhone != value)
				 {
					_homePhone = value;
					 PropertyHasChanged("HomePhone");
				 }
			 }
		}

		public string  CellPhone
		{
			 get { return _cellPhone; }
			 set
			 {
				 if (_cellPhone != value)
				 {
					_cellPhone = value;
					 PropertyHasChanged("CellPhone");
				 }
			 }
		}

		public string  Email
		{
			 get { return _email; }
			 set
			 {
				 if (_email != value)
				 {
					_email = value;
					 PropertyHasChanged("Email");
				 }
			 }
		}

		public string  UserType
		{
			 get { return _userType; }
			 set
			 {
				 if (_userType != value)
				 {
					_userType = value;
					 PropertyHasChanged("UserType");
				 }
			 }
		}

		public bool?  Deleted
		{
			 get { return _deleted; }
			 set
			 {
				 if (_deleted != value)
				 {
					_deleted = value;
					 PropertyHasChanged("Deleted");
				 }
			 }
		}


		#endregion

		#region Validation

		internal override void AddValidationRules()
		{
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("UserID", "UserID"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("UserName", "UserName",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Password", "Password",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Name", "Name",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Address", "Address",200));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("District", "District",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("City", "City",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("HomePhone", "HomePhone",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("CellPhone", "CellPhone",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Email", "Email",100));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("UserType", "UserType",10));
		}

		#endregion

	}
}
